package lab03;

import java.sql.*;

/**
 * Created by 123 on 2017/12/8.
 */
public class Hello {

    public static void main(String[] args) {
        Connection connection=null;
        Statement   statement=null;
        ResultSet resultSet=null;

//        String sql="insert into t_users(id,username,password,registerdatetime)" +
//                "VALUES(1,'admin','admin','1923123321')";
        String sql1="insert into t_users(id,username,password,registerdatetime)" +
                "VALUES(2,'chen','123456','123456789')";


        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection= DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/java_2017?serverTimezone=UTC",
                    "root",
                    "123456"
            );

            statement=connection.createStatement();
            //statement.execute(sql);
            statement.execute(sql1);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }




}
